3.14 \(\int \frac{(a+b x)^2 \sin (c+d x)}{x^2} \, dx\)

Optimal. Leaf size=72 \[ a^2 d \cos (c) \text{CosIntegral}(d x)-a^2 d \sin (c) \text{Si}(d x)-\frac{a^2 \sin (c+d x)}{x}+2 a b \sin (c) \text{CosIntegral}(d x)+2 a b \cos (c) \text{Si}(d x)-\frac{b^2 \cos (c+d x)}{d} \]

[Out]

-((b^2*Cos[c + d*x])/d) + a^2*d*Cos[c]*CosIntegral[d*x] + 2*a*b*CosIntegral[d*x]*Sin[c] - (a^2*Sin[c + d*x])/x
 + 2*a*b*Cos[c]*SinIntegral[d*x] - a^2*d*Sin[c]*SinIntegral[d*x]

________________________________________________________________________________________

Rubi [A]  time = 0.242429, antiderivative size = 72, normalized size of antiderivative = 1., number of steps used = 10, number of rules used = 6, integrand size = 17, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.353, Rules used = {6742, 2638, 3297, 3303, 3299, 3302} \[ a^2 d \cos (c) \text{CosIntegral}(d x)-a^2 d \sin (c) \text{Si}(d x)-\frac{a^2 \sin (c+d x)}{x}+2 a b \sin (c) \text{CosIntegral}(d x)+2 a b \cos (c) \text{Si}(d x)-\frac{b^2 \cos (c+d x)}{d} \]

Antiderivative was successfully verified.

[In]

Int[((a + b*x)^2*Sin[c + d*x])/x^2,x]

[Out]

-((b^2*Cos[c + d*x])/d) + a^2*d*Cos[c]*CosIntegral[d*x] + 2*a*b*CosIntegral[d*x]*Sin[c] - (a^2*Sin[c + d*x])/x
 + 2*a*b*Cos[c]*SinIntegral[d*x] - a^2*d*Sin[c]*SinIntegral[d*x]

Rule 6742

Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v]]

Rule 2638

Int[sin[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Cos[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 3297

Int[((c_.) + (d_.)*(x_))^(m_)*sin[(e_.) + (f_.)*(x_)], x_Symbol] :> Simp[((c + d*x)^(m + 1)*Sin[e + f*x])/(d*(
m + 1)), x] - Dist[f/(d*(m + 1)), Int[(c + d*x)^(m + 1)*Cos[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && LtQ[
m, -1]

Rule 3303

Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Dist[Cos[(d*e - c*f)/d], Int[Sin[(c*f)/d + f*x]
/(c + d*x), x], x] + Dist[Sin[(d*e - c*f)/d], Int[Cos[(c*f)/d + f*x]/(c + d*x), x], x] /; FreeQ[{c, d, e, f},
x] && NeQ[d*e - c*f, 0]

Rule 3299

Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[SinIntegral[e + f*x]/d, x] /; FreeQ[{c, d,
 e, f}, x] && EqQ[d*e - c*f, 0]

Rule 3302

Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[CosIntegral[e - Pi/2 + f*x]/d, x] /; FreeQ
[{c, d, e, f}, x] && EqQ[d*(e - Pi/2) - c*f, 0]

Rubi steps

\begin{align*} \int \frac{(a+b x)^2 \sin (c+d x)}{x^2} \, dx &=\int \left (b^2 \sin (c+d x)+\frac{a^2 \sin (c+d x)}{x^2}+\frac{2 a b \sin (c+d x)}{x}\right ) \, dx\\ &=a^2 \int \frac{\sin (c+d x)}{x^2} \, dx+(2 a b) \int \frac{\sin (c+d x)}{x} \, dx+b^2 \int \sin (c+d x) \, dx\\ &=-\frac{b^2 \cos (c+d x)}{d}-\frac{a^2 \sin (c+d x)}{x}+\left (a^2 d\right ) \int \frac{\cos (c+d x)}{x} \, dx+(2 a b \cos (c)) \int \frac{\sin (d x)}{x} \, dx+(2 a b \sin (c)) \int \frac{\cos (d x)}{x} \, dx\\ &=-\frac{b^2 \cos (c+d x)}{d}+2 a b \text{Ci}(d x) \sin (c)-\frac{a^2 \sin (c+d x)}{x}+2 a b \cos (c) \text{Si}(d x)+\left (a^2 d \cos (c)\right ) \int \frac{\cos (d x)}{x} \, dx-\left (a^2 d \sin (c)\right ) \int \frac{\sin (d x)}{x} \, dx\\ &=-\frac{b^2 \cos (c+d x)}{d}+a^2 d \cos (c) \text{Ci}(d x)+2 a b \text{Ci}(d x) \sin (c)-\frac{a^2 \sin (c+d x)}{x}+2 a b \cos (c) \text{Si}(d x)-a^2 d \sin (c) \text{Si}(d x)\\ \end{align*}

Mathematica [A]  time = 0.253961, size = 64, normalized size = 0.89 \[ -\frac{a^2 \sin (c+d x)}{x}+a \text{CosIntegral}(d x) (a d \cos (c)+2 b \sin (c))-a \text{Si}(d x) (a d \sin (c)-2 b \cos (c))-\frac{b^2 \cos (c+d x)}{d} \]

Antiderivative was successfully verified.

[In]

Integrate[((a + b*x)^2*Sin[c + d*x])/x^2,x]

[Out]

-((b^2*Cos[c + d*x])/d) + a*CosIntegral[d*x]*(a*d*Cos[c] + 2*b*Sin[c]) - (a^2*Sin[c + d*x])/x - a*(-2*b*Cos[c]
 + a*d*Sin[c])*SinIntegral[d*x]

________________________________________________________________________________________

Maple [A]  time = 0.019, size = 74, normalized size = 1. \begin{align*} d \left ( -{\frac{{b}^{2}\cos \left ( dx+c \right ) }{{d}^{2}}}+2\,{\frac{ab \left ({\it Si} \left ( dx \right ) \cos \left ( c \right ) +{\it Ci} \left ( dx \right ) \sin \left ( c \right ) \right ) }{d}}+{a}^{2} \left ( -{\frac{\sin \left ( dx+c \right ) }{dx}}-{\it Si} \left ( dx \right ) \sin \left ( c \right ) +{\it Ci} \left ( dx \right ) \cos \left ( c \right ) \right ) \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((b*x+a)^2*sin(d*x+c)/x^2,x)

[Out]

d*(-1/d^2*b^2*cos(d*x+c)+2/d*a*b*(Si(d*x)*cos(c)+Ci(d*x)*sin(c))+a^2*(-sin(d*x+c)/x/d-Si(d*x)*sin(c)+Ci(d*x)*c
os(c)))

________________________________________________________________________________________

Maxima [C]  time = 3.28563, size = 166, normalized size = 2.31 \begin{align*} \frac{{\left ({\left (a^{2}{\left (\Gamma \left (-1, i \, d x\right ) + \Gamma \left (-1, -i \, d x\right )\right )} \cos \left (c\right ) - a^{2}{\left (i \, \Gamma \left (-1, i \, d x\right ) - i \, \Gamma \left (-1, -i \, d x\right )\right )} \sin \left (c\right )\right )} d^{2} -{\left (a b{\left (-2 i \, \Gamma \left (-1, i \, d x\right ) + 2 i \, \Gamma \left (-1, -i \, d x\right )\right )} \cos \left (c\right ) - 2 \, a b{\left (\Gamma \left (-1, i \, d x\right ) + \Gamma \left (-1, -i \, d x\right )\right )} \sin \left (c\right )\right )} d\right )} x - 2 \,{\left (b^{2} x + 2 \, a b\right )} \cos \left (d x + c\right )}{2 \, d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)^2*sin(d*x+c)/x^2,x, algorithm="maxima")

[Out]

1/2*(((a^2*(gamma(-1, I*d*x) + gamma(-1, -I*d*x))*cos(c) - a^2*(I*gamma(-1, I*d*x) - I*gamma(-1, -I*d*x))*sin(
c))*d^2 - (a*b*(-2*I*gamma(-1, I*d*x) + 2*I*gamma(-1, -I*d*x))*cos(c) - 2*a*b*(gamma(-1, I*d*x) + gamma(-1, -I
*d*x))*sin(c))*d)*x - 2*(b^2*x + 2*a*b)*cos(d*x + c))/(d*x)

________________________________________________________________________________________

Fricas [A]  time = 1.76644, size = 346, normalized size = 4.81 \begin{align*} -\frac{2 \, b^{2} x \cos \left (d x + c\right ) + 2 \, a^{2} d \sin \left (d x + c\right ) -{\left (a^{2} d^{2} x \operatorname{Ci}\left (d x\right ) + a^{2} d^{2} x \operatorname{Ci}\left (-d x\right ) + 4 \, a b d x \operatorname{Si}\left (d x\right )\right )} \cos \left (c\right ) + 2 \,{\left (a^{2} d^{2} x \operatorname{Si}\left (d x\right ) - a b d x \operatorname{Ci}\left (d x\right ) - a b d x \operatorname{Ci}\left (-d x\right )\right )} \sin \left (c\right )}{2 \, d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)^2*sin(d*x+c)/x^2,x, algorithm="fricas")

[Out]

-1/2*(2*b^2*x*cos(d*x + c) + 2*a^2*d*sin(d*x + c) - (a^2*d^2*x*cos_integral(d*x) + a^2*d^2*x*cos_integral(-d*x
) + 4*a*b*d*x*sin_integral(d*x))*cos(c) + 2*(a^2*d^2*x*sin_integral(d*x) - a*b*d*x*cos_integral(d*x) - a*b*d*x
*cos_integral(-d*x))*sin(c))/(d*x)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\left (a + b x\right )^{2} \sin{\left (c + d x \right )}}{x^{2}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)**2*sin(d*x+c)/x**2,x)

[Out]

Integral((a + b*x)**2*sin(c + d*x)/x**2, x)

________________________________________________________________________________________

Giac [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: TypeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)^2*sin(d*x+c)/x^2,x, algorithm="giac")

[Out]

Exception raised: TypeError